package pack1;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.Assert;

public class ProjectSpecific extends SuperTestNG{

	public static void login(String un,String pw)
{
	driver.findElement(By.name("username")).sendKeys(un);
	driver.findElement(By.name("pwd")).sendKeys(pw);
	driver.findElement(By.id("loginButton")).click();
	}



public static void logOut()
{driver.findElement(By.id("logoutLink")).click();
	//RemoteWebDriver r=new RemoteW;
	}
public static void gotoTasks()
{ driver.findElement(By.xpath("//div[text()='Tasks']")).click();
	}
public static void gotoProjectsAndCustomers()
{driver.findElement(By.linkText("Projects & Customers")).click();
	}
public static void gotoNewCustomerPage()
{
	driver.findElement(By.xpath("//input[@value='Create New Customer']")).click();
	
}

public static void createCustomer(String cName)
{driver.findElement(By.name("name")).sendKeys(cName);
driver.findElement(By.name("createCustomerSubmit")).click();
	}

public static void createCustomer(String cName,String pwd)
{driver.findElement(By.name("name")).sendKeys(cName);
driver.findElement(By.xpath("//*[@name='passwordText']")).sendKeys(pwd);
driver.findElement(By.xpath("//*[@name='passwordTextRetype']")).sendKeys(pwd);
driver.findElement(By.name("createCustomerSubmit")).click();
	}
public static void verifyTitle(String eTitle)
{
	Generic.explicitWait(3);
	String aTitle=driver.getTitle();
	Assert.assertEquals(aTitle,eTitle);
	}
public static void verifyErrorMsg(String eErrMsg)
{
	String aErrMsg=driver.findElement(By.className("errormsg")).getText();
	Assert.assertEquals(aErrMsg,eErrMsg);
	}

public static void verifySuccessMsg(String eSuccessMsg)
{String aSuccessMsg=driver.findElement(By.className("successmsg")).getText();
Assert.assertEquals(aSuccessMsg, eSuccessMsg);
}


}
